Optimal. Leaf size=86 \[ -\frac {\left (-2 a c d+b^2 d-b c e\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^2 \sqrt {b^2-4 a c}}-\frac {(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}+\frac {d x}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {1393, 773, 634, 618, 206, 628} \[ -\frac {\left (-2 a c d+b^2 d-b c e\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^2 \sqrt {b^2-4 a c}}-\frac {(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}+\frac {d x}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 773
Rule 1393
Rubi steps
\begin {align*} \int \frac {d+\frac {e}{x}}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx &=\int \frac {x (e+d x)}{a+b x+c x^2} \, dx\\ &=\frac {d x}{c}+\frac {\int \frac {-a d+(-b d+c e) x}{a+b x+c x^2} \, dx}{c}\\ &=\frac {d x}{c}-\frac {(b d-c e) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 c^2}+\frac {\left (b^2 d-2 a c d-b c e\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 c^2}\\ &=\frac {d x}{c}-\frac {(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}-\frac {\left (b^2 d-2 a c d-b c e\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^2}\\ &=\frac {d x}{c}-\frac {\left (b^2 d-2 a c d-b c e\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^2 \sqrt {b^2-4 a c}}-\frac {(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.09, size = 86, normalized size = 1.00 \[ \frac {\frac {2 \left (-2 a c d+b^2 d-b c e\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {4 a c-b^2}}\right )}{\sqrt {4 a c-b^2}}+(c e-b d) \log (a+x (b+c x))+2 c d x}{2 c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.84, size = 291, normalized size = 3.38 \[ \left [\frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d x + {\left (b c e - {\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt {b^{2} - 4 \, a c} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - {\left ({\left (b^{3} - 4 \, a b c\right )} d - {\left (b^{2} c - 4 \, a c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}, \frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d x + 2 \, {\left (b c e - {\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) - {\left ({\left (b^{3} - 4 \, a b c\right )} d - {\left (b^{2} c - 4 \, a c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.32, size = 85, normalized size = 0.99 \[ \frac {d x}{c} - \frac {{\left (b d - c e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} + \frac {{\left (b^{2} d - 2 \, a c d - b c e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.00, size = 161, normalized size = 1.87 \[ -\frac {2 a d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}+\frac {b^{2} d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c^{2}}-\frac {b e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}-\frac {b d \ln \left (c \,x^{2}+b x +a \right )}{2 c^{2}}+\frac {d x}{c}+\frac {e \ln \left (c \,x^{2}+b x +a \right )}{2 c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.77, size = 127, normalized size = 1.48 \[ \frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (d\,b^3-e\,b^2\,c-4\,a\,d\,b\,c+4\,a\,e\,c^2\right )}{2\,\left (4\,a\,c^3-b^2\,c^2\right )}+\frac {d\,x}{c}-\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )\,\left (-d\,b^2+c\,e\,b+2\,a\,c\,d\right )}{c^2\,\sqrt {4\,a\,c-b^2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 1.37, size = 423, normalized size = 4.92 \[ \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac {b d - c e}{2 c^{2}}\right ) \log {\left (x + \frac {- a b d - 4 a c^{2} \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac {b d - c e}{2 c^{2}}\right ) + 2 a c e + b^{2} c \left (- \frac {\sqrt {- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac {b d - c e}{2 c^{2}}\right )}{2 a c d - b^{2} d + b c e} \right )} + \left (\frac {\sqrt {- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac {b d - c e}{2 c^{2}}\right ) \log {\left (x + \frac {- a b d - 4 a c^{2} \left (\frac {\sqrt {- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac {b d - c e}{2 c^{2}}\right ) + 2 a c e + b^{2} c \left (\frac {\sqrt {- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac {b d - c e}{2 c^{2}}\right )}{2 a c d - b^{2} d + b c e} \right )} + \frac {d x}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________